﻿@model PagedList.IPagedList<HdipCricketClub.Models.PlayerSeasonStatistic>

@{
    ViewBag.Title = "Season Statistics";
}

<h2>Season Statistics</h2>

@using (Html.BeginForm())
{
    <p>
        Find by Last Name: @Html.TextBox("SearchString")
        <input type="submit" value="Search" />
    </p>
}

<table>
    <tr>
        <th class="column-statistics">
            Name:
        </th>
        <th class="column-statistics">
            Matches:
        </th>
        <th class="column-statistics">
            innings:
        </th>
        <th class="column-statistics">
            Not Out:
        </th>
        <th class="column-statistics">
            Runs:
        </th>
        <th class="column-statistics">
            Average:
        </th>
        <th class="column-statistics">
            H.S:
        </th>
        <th class="column-statistics">
            Overs:
        </th>
        <th class="column-statistics">
            Maidens:
        </th>
        <th class="column-statistics">
            Runs:
        </th>
        <th class="column-statistics">
            Wickets:
        </th>
        <th class="column-statistics">
            Average:
        </th>
        <th class="column-statistics">
            Runs/Over:
        </th>
        <th class="column-statistics">
            B.B:
        </th>
        
     </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Member.first_name) @Html.DisplayFor(modelItem => item.Member.last_name)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.matches)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.innings)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.not_out)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.batting_runs)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.BattingAverage)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.best_batting)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.overs)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.maidens)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.bowling_runs)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.wickets)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.BowlingAverage)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.RunsPerOver)
        </td>
        <td class="column_numbers">
            @Html.DisplayFor(modelItem => item.best_bowling_wickets) / @Html.DisplayFor(modelItem => item.best_bowling_runs)
        </td>
        
     </tr>
}

</table>
<br />
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount

    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "SeasonStatistics", new { page = 1 })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "SeasonStatistics", new { page = Model.PageNumber - 1 })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev              
    }

    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "SeasonStatistics", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "SeasonStatistics", new { page = Model.PageCount })
    }
    else
    {
        @:Next >
        @Html.Raw(" ");
        @:>>              
    }
</div>
<br />
<div>
        @Html.ActionLink("Return to Home Page", "Index", "Home")
</ div>